home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: "Gary A. Fleming" <gfleming@ix.netcom.com>
- Newsgroups: comp.lang.c++
- Subject: OWL 2.00 Programmers - Help with direct TBitmap construction please
- Date: Sat, 10 Feb 1996 00:47:10 -0500
- Organization: Netcom
- Message-ID: <311C315E.1947@ix.netcom.com>
- NNTP-Posting-Host: ix-nor-va3-21.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-NETCOM-Date: Fri Feb 09 9:46:00 PM PST 1996
- X-Mailer: Mozilla 2.0b6a (Win95; I)
- CC: gfleming@ix.netcom.com
-
- Dear Netters:
-
- A simple question for you OWL 2.00 programmers. I have a 512 x 512
- unsigned character array in local memory that I would like to display as
- a 256 color bitmap in a frame control placed in a dialog box. I am
- running Borland C++ 4.0 and am trying to construct and display the
- bitmap by constructing a TBitmap directly. I have had success in
- reading *.bmpÆs from disk and displaying those, but have had no success
- in direct construction of a Tbitmap. I am using the following steps in
- attempt to construct my bitmap image:
-
- 1. Allocate variables and pointers
- 2. Bitmap=new Tbitmap(512,512,1,8,data) where data=unsigned char
- [262144] (262144=512x512)
- 3. Construct a TPalette object from a 256 entry PALETTEENTRY array of
- RGB values
- 4. Construct a TMemoryDC object and select the Bitmap using
- SelectObject(Bitmap)
- 5. Realize the palette for the memorydc
- 6. Create the dialog box and frame control
- 7. Create a source DC from the dialog box and select the frame control
- using SelectObject(frame_control)
- 8. Realize the palette for the sourceDC
- 9. Perform a sourceDC->BitBlt(width,height,*memorydc,0,0,SRCCOPY)
-
- After performing these steps, no image is displayed in the frame control
- (or anywhere else for that matter). What steps am I missing?
-
- Any help would be appreciated. Thanks in advance,
-
- Gary Fleming
- gfleming@ix.netcom.com
-